import axios from '@/libs/request/axios'

// 获取全部权限数据
export const getAllPermissionList = (params) => {
    return axios.request({
        url: '/admin/permission/getAllList',
        params: params,
        method: 'get'
    })
}
// 添加权限
export const addPermission = (params) => {
    return axios.request({
        url: '/admin/permission/add',
        data: params,
        method: 'post'
    })
}
// 编辑权限
export const editPermission = (params) => {
    delete params.permTypes;
    return axios.request({
        url: '/admin/permission/edit',
        data: params,
        method: 'post'
    })
}
// 删除权限
export const deletePermission = (ids, params) => {
    return axios.request({
        url: `/admin/permission/delByIds/${ids}`,
        params: params,
        method: 'delete'
    })
}
// 搜索权限
export const searchPermission = (params) => {
    return axios.request({
        url: '/admin/permission/search',
        params: params,
        method: 'get'
    })
}
//获取当前用户菜单列表
export function GetMenu() {
    return axios.request({
        url: '/admin/permission/getMenuList',
        method: 'get'
    })
}
